<!-- 定期排查-手工选择弹窗 -->
<template>
	<view class="fill-container">
		<u-modal v-model="show" title="检查标准" @confirm="confirm">
			<view class="slot-content">
				<uni-table ref="table" :loading="loading" border stripe type="selection" emptyText="暂无更多数据"
					@selection-change="selectionChange">
					<uni-tr>
						<uni-th align="center">序号</uni-th>
						<uni-th align="center">检查类别</uni-th>
						<uni-th align="center">检查分类</uni-th>
						<uni-th align="center">检查范围</uni-th>
						<uni-th align="center">检查标准</uni-th>
						<uni-th align="center">检查依据</uni-th>
					</uni-tr>
					<uni-tr v-for="(item, index) in tableData" :key="index">
						<uni-td>{{ index+ 1 }}</uni-td>
						<uni-td>
							<view class="name">{{ item.inspectionCategoryName }}</view>
						</uni-td>
						<uni-td align="center">{{ item.inspectionClassifyName }}</uni-td>

						<uni-td align="center">{{ item.inspectionScopeName }}</uni-td>
						<uni-td align="center">{{ item.inspectionStandard }}</uni-td>
						<uni-td align="center">{{ item.inspectionBasis }}</uni-td>
					</uni-tr>
				</uni-table>
			</view>
		</u-modal>
	</view>
</template>
<script>
	import {
		searchStand
	} from "@/api/hiddenTrouble/periodShoot.js"
	export default {
		data() {
			return {
				show: false,
				//选中的数据的索引
				selectedIndexs: [],
				//选中数据
				selectDatas: [],
				tableData: [],
				// 每页数据量
				pageSize: 10,
				// 当前页
				pageCurrent: 1,
				// 数据总量
				total: 0,
				loading: false,
			
			}
		},
		methods: {
			changeShow() {
				this.show = !this.show
			},
			// 确定按钮
			confirm() {
				// this.selectDatas
				this.$emit("manualCheck", this.selectDatas)

			},

			//获取检查标准
			async getStandard() {
				//是否需要条件
				let res = await searchStand()
				this.tableData = res.rows
				console.log("ppppp", res)
			},
			// 多选
			selectionChange(e) {
				let arrList = []
				this.selectedIndexs = e.detail.index
				// 将数组中的值，作为table表格数组的下标来获取对应的当前行数据
				this.selectedIndexs.map(i => {
					arrList.push(this.tableData[i])
				})
				this.selectDatas = arrList
			},
		},
		mounted() {
			this.getStandard()
		}
	}
</script>
<style lang="scss" scoped>
	.fill-container {}
</style>